package cn.wolfcode.springcloud.service.impl;

import cn.wolfcode.springcloud.domain.Product;
import cn.wolfcode.springcloud.mapper.ProductMapper;
import cn.wolfcode.springcloud.service.IProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class ProductServiceImpl implements IProductService {
    @Autowired
    private ProductMapper productMapper;

    @Override
    public void save(Product product) {
        productMapper.save(product);
    }

    @Override
    public Product get(Long id) {

        //记录调用日志
        log.info("ProductServiceImpl.get....");
        return productMapper.get(id);
    }
}